package com.class05.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @ClassDescription: 可以被web项目加载，会初始化ioc容器，会设置dispatcherServlet的地址
 * 初始化文件
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2023/11/30 15:17
 */
public class SpringMvcInit extends
        AbstractAnnotationConfigDispatcherServletInitializer {
    @Override//service mapper层的ioc配置
    protected Class<?>[] getRootConfigClasses() {
        return new Class[0];
    }

    @Override//springmvc 需要组件的配置类
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{MvcConfig.class};
    }

    @Override//servlet  DispatcherServlet
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
